package com.ruoyi.project.relation.domain.builder;

import com.ruoyi.project.relation.domain.dto.BusinessRelationDO;
import com.ruoyi.project.relation.domain.qo.BusinessRelationQO;

/**
 *
 **/
public final class BusinessRelationQOBuilder {
    private Long sourceOwnerId;
    private String sourceOwnerName;
    private String sourceOwnerType;
    private Long targetOwnerId;
    private String targetOwnerName;
    private String targetOwnerType;
    private Integer delFlag=0;

    private BusinessRelationQOBuilder() {
    }

    public BusinessRelationQOBuilder sourceOwner(BusinessRelationDO sourceOwner){
        sourceOwnerType(sourceOwner.getOwnerType())
                .sourceOwnerId(sourceOwner.getOwnerId())
                .sourceOwnerName(sourceOwner.getOwnerName());
        return this;
    }

    public BusinessRelationQOBuilder targetOwner(BusinessRelationDO sourceOwner){
        targetOwnerType(sourceOwner.getOwnerType())
                .targetOwnerId(sourceOwner.getOwnerId())
                .targetOwnerName(sourceOwner.getOwnerName());
        return this;
    }

    public static BusinessRelationQOBuilder newBusinessRelationQO() {
        return new BusinessRelationQOBuilder();
    }

    public BusinessRelationQOBuilder sourceOwnerId(Long sourceOwnerId) {
        this.sourceOwnerId = sourceOwnerId;
        return this;
    }

    public BusinessRelationQOBuilder sourceOwnerName(String sourceOwnerName) {
        this.sourceOwnerName = sourceOwnerName;
        return this;
    }

    public BusinessRelationQOBuilder sourceOwnerType(String sourceOwnerType) {
        this.sourceOwnerType = sourceOwnerType;
        return this;
    }

    public BusinessRelationQOBuilder targetOwnerId(Long targetOwnerId) {
        this.targetOwnerId = targetOwnerId;
        return this;
    }

    public BusinessRelationQOBuilder targetOwnerName(String targetOwnerName) {
        this.targetOwnerName = targetOwnerName;
        return this;
    }

    public BusinessRelationQOBuilder targetOwnerType(String targetOwnerType) {
        this.targetOwnerType = targetOwnerType;
        return this;
    }

    public BusinessRelationQOBuilder delFlag(Integer delFlag) {
        this.delFlag = delFlag;
        return this;
    }

    public BusinessRelationQO build() {
        BusinessRelationQO businessRelationQO = new BusinessRelationQO();
        businessRelationQO.setSourceOwnerId(sourceOwnerId);
        businessRelationQO.setSourceOwnerName(sourceOwnerName);
        businessRelationQO.setSourceOwnerType(sourceOwnerType);
        businessRelationQO.setTargetOwnerId(targetOwnerId);
        businessRelationQO.setTargetOwnerName(targetOwnerName);
        businessRelationQO.setTargetOwnerType(targetOwnerType);
        businessRelationQO.setDelFlag(delFlag);
        return businessRelationQO;
    }
}
